#!/usr/bin/perl -w   # useful for syntax highlighting
package clreqd_modules;

use Data::Dumper;

sub show_commands {
	my @l=();
	for my $cmd (sort keys(%::REQUESTS)) {
		my $str="$cmd ";
		if(length($::REQUESTS{$cmd}->{mandatory})) {
			$str.="Args=";
			$str.=join(",",(sort(split(/\s+/,$::REQUESTS{$cmd}->{mandatory}))));
			$str.=" ";
		}
		if(length($::REQUESTS{$cmd}->{optional})) {
			$str.="Optional=".join(",",(sort(split(/\s+/,$::REQUESTS{$cmd}->{optional}))));
			$str.=" ";
		}
		if(length($::REQUESTS{$cmd}->{text})) {
			$str.="Description=\"$::REQUESTS{$cmd}->{text}\"";
		}
		push @l,$str;

	}
	return join("\n",@l);
}

1;
